Implement xen_vm_set_vcpus_number,
authorEwan Mellor <ewan@xensource.com>
Sat, 9 Dec 2006 17:16:52 +0000 (17:16 +0000)
committerEwan Mellor <ewan@xensource.com>
Sat, 9 Dec 2006 17:16:52 +0000 (17:16 +0000)
xen_vm_{add,remove}_vcpus_features_force{on,off}.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/libxen/include/xen_vm.h
tools/libxen/src/xen_vm.c

index 714ade6b1612bac29639d4fd6b12ec2387fc7638..02ae5220cdd0ef6cad5573e1a05540d22637cc29 100644 (file)
@@ -606,6 +606,13 @@ extern bool
 xen_vm_set_vcpus_params(xen_session *session, xen_vm vm, char *params);
 
 
+/**
+ * Set the VCPUs/number field of the given VM.
+ */
+extern bool
+xen_vm_set_vcpus_number(xen_session *session, xen_vm vm, int64_t number);
+
+
 /**
  * Set the VCPUs/features/force_on field of the given VM.
  */
@@ -613,6 +620,22 @@ extern bool
 xen_vm_set_vcpus_features_force_on(xen_session *session, xen_vm vm, struct xen_cpu_feature_set *force_on);
 
 
+/**
+ * Add the given value to the VCPUs/features/force_on field of the
+ * given VM.  If the value is already in that Set, then do nothing.
+ */
+extern bool
+xen_vm_add_vcpus_features_force_on(xen_session *session, xen_vm vm, enum xen_cpu_feature value);
+
+
+/**
+ * Remove the given value from the VCPUs/features/force_on field of the
+ * given VM.  If the value is not in that Set, then do nothing.
+ */
+extern bool
+xen_vm_remove_vcpus_features_force_on(xen_session *session, xen_vm vm, enum xen_cpu_feature value);
+
+
 /**
  * Set the VCPUs/features/force_off field of the given VM.
  */
@@ -620,6 +643,22 @@ extern bool
 xen_vm_set_vcpus_features_force_off(xen_session *session, xen_vm vm, struct xen_cpu_feature_set *force_off);
 
 
+/**
+ * Add the given value to the VCPUs/features/force_off field of the
+ * given VM.  If the value is already in that Set, then do nothing.
+ */
+extern bool
+xen_vm_add_vcpus_features_force_off(xen_session *session, xen_vm vm, enum xen_cpu_feature value);
+
+
+/**
+ * Remove the given value from the VCPUs/features/force_off field of
+ * the given VM.  If the value is not in that Set, then do nothing.
+ */
+extern bool
+xen_vm_remove_vcpus_features_force_off(xen_session *session, xen_vm vm, enum xen_cpu_feature value);
+
+
 /**
  * Set the actions/after_shutdown field of the given VM.
  */
index 22ba6cc266bb110eac5057b15129991b20f6df41..bffab2bab9b59dd8f5de2fa1af7021524f990591 100644 (file)
@@ -1180,6 +1180,22 @@ xen_vm_set_vcpus_params(xen_session *session, xen_vm vm, char *params)
 }
 
 
+bool
+xen_vm_set_vcpus_number(xen_session *session, xen_vm vm, int64_t number)
+{
+    abstract_value param_values[] =
+        {
+            { .type = &abstract_type_string,
+              .u.string_val = vm },
+            { .type = &abstract_type_int,
+              .u.int_val = number }
+        };
+
+    xen_call_(session, "VM.set_VCPUs_number", param_values, 2, NULL, NULL);
+    return session->ok;
+}
+
+
 bool
 xen_vm_set_vcpus_features_force_on(xen_session *session, xen_vm vm, struct xen_cpu_feature_set *force_on)
 {
@@ -1196,6 +1212,38 @@ xen_vm_set_vcpus_features_force_on(xen_session *session, xen_vm vm, struct xen_c
 }
 
 
+bool
+xen_vm_add_vcpus_features_force_on(xen_session *session, xen_vm vm, enum xen_cpu_feature value)
+{
+    abstract_value param_values[] =
+        {
+            { .type = &abstract_type_string,
+              .u.string_val = vm },
+            { .type = &xen_cpu_feature_abstract_type_,
+              .u.string_val = xen_cpu_feature_to_string(value) }
+        };
+
+    xen_call_(session, "VM.add_VCPUs_features_force_on", param_values, 2, NULL, NULL);
+    return session->ok;
+}
+
+
+bool
+xen_vm_remove_vcpus_features_force_on(xen_session *session, xen_vm vm, enum xen_cpu_feature value)
+{
+    abstract_value param_values[] =
+        {
+            { .type = &abstract_type_string,
+              .u.string_val = vm },
+            { .type = &xen_cpu_feature_abstract_type_,
+              .u.string_val = xen_cpu_feature_to_string(value) }
+        };
+
+    xen_call_(session, "VM.remove_VCPUs_features_force_on", param_values, 2, NULL, NULL);
+    return session->ok;
+}
+
+
 bool
 xen_vm_set_vcpus_features_force_off(xen_session *session, xen_vm vm, struct xen_cpu_feature_set *force_off)
 {
@@ -1212,6 +1260,38 @@ xen_vm_set_vcpus_features_force_off(xen_session *session, xen_vm vm, struct xen_
 }
 
 
+bool
+xen_vm_add_vcpus_features_force_off(xen_session *session, xen_vm vm, enum xen_cpu_feature value)
+{
+    abstract_value param_values[] =
+        {
+            { .type = &abstract_type_string,
+              .u.string_val = vm },
+            { .type = &xen_cpu_feature_abstract_type_,
+              .u.string_val = xen_cpu_feature_to_string(value) }
+        };
+
+    xen_call_(session, "VM.add_VCPUs_features_force_off", param_values, 2, NULL, NULL);
+    return session->ok;
+}
+
+
+bool
+xen_vm_remove_vcpus_features_force_off(xen_session *session, xen_vm vm, enum xen_cpu_feature value)
+{
+    abstract_value param_values[] =
+        {
+            { .type = &abstract_type_string,
+              .u.string_val = vm },
+            { .type = &xen_cpu_feature_abstract_type_,
+              .u.string_val = xen_cpu_feature_to_string(value) }
+        };
+
+    xen_call_(session, "VM.remove_VCPUs_features_force_off", param_values, 2, NULL, NULL);
+    return session->ok;
+}
+
+
 bool
 xen_vm_set_actions_after_shutdown(xen_session *session, xen_vm vm, enum xen_on_normal_exit after_shutdown)
 {